package com.hisan.waimaidao.carvas;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hisan.waimaidao.myview.Anim;
import com.hisan.waimaidao.myview.AnimLunZi;
import com.hisan.waimaidao.myview.AnimShanXing;
import com.hisan.waimaidao.myview.EnterAnimLayout;

/**
 * 创建时间 : 2017/9/23
 * 创建人：yangyingqi
 * 公司：嘉善和盛网络有限公司
 * 备注：无
 */
public class AnimActivity extends AppCompatActivity implements View.OnClickListener {
    private Anim anim,anim1;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim);
        findViewById(R.id.lunzi).setOnClickListener(this);
        findViewById(R.id.shanying).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        EnterAnimLayout viewParent = (EnterAnimLayout) view.getParent();
        switch (view.getId()){
            case R.id.lunzi:
                anim=new AnimLunZi(viewParent);
                break;
            case R.id.shanying:
                anim=new AnimShanXing(viewParent);
                break;
        }
        anim.startAnimation(2000);
    }
}
